#!/bin/bash

prepare(){
cat README.html | \
  sed -e 's/fonts.googleapis.com\/css/www.8ops.top\/asset\/index.css/g' \
      -e 's/file:\/\/.*github/asset/g' \
      -e 's/README/运维吧/g' > index.html

cat >> index.html <<EOF
<center>
<a href="https://www.8ops.top/" target="_blank" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;" ><p style="text-align:center;float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">运维吧 </p></a>
<br />
<a href="http://beian.miit.gov.cn/" target="_blank" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;" ><p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;"> 沪ICP备18030892号 </p> </a>
<br />
<a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=31011502016733" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;"><img src="asset/wa.png" style="float:left;"/><p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">沪公网安备 31011502016733号</p></a>
<br />
<a target="_blank" href="https://www.upyun.com/?utm_source=lianmeng&utm_medium=referral&invite=HJikJr9NZ" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;"><img src="asset/upyun.png" style="float:left;height:25px;"/><p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">提供CDN加速/云存储服务</p></a>
<br/>
</center>	
EOF
}

deploy(){
upx switch jesse-8ops-www

upx put index.html index.html
upx put favicon.ico favicon.ico
upx sync --delete asset/ asset/

upx switch jesse-8ops-normal
}

prepare
deploy

